package cn.kgc.vue.controller;

import cn.kgc.vue.common.ResponseResult;
import cn.kgc.vue.common.ResponseStatus;
import cn.kgc.vue.form.LogLsitForm;
import cn.kgc.vue.service.LogInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/***
 *@title LogController
 *@author 韩旭
 *@version 1.0.0
 *@create 2023/8/20 22:10
 **/
@RestController
@RequestMapping("log")
public class LogController {
    @Autowired
    private LogInfoService infoService;

    @GetMapping("getlist")
    public ResponseResult getlist(LogLsitForm logLsitForm){
        return infoService.getlist(logLsitForm);
    }

    //删除
    @DeleteMapping("delete")
    public ResponseResult delete(@RequestBody List<Integer> ids){
        infoService.removeBatchByIds(ids);
        ResponseResult responseResult = new ResponseResult();
        responseResult.success(ResponseStatus.DELETE_SUCCESS);
        return responseResult;
    }
}
